#%%
import pandas as pd

from DresssenceModel import *

color_source = pd.read_excel("ColorDataSource.xlsx")
color_extracted = {
    "color_hlc": color_source["color_hlc"].to_list(),
    "color_rgb": color_source["color_rgb"].to_list(),
}

color_medium, color_basic = [], []
for medium in ColorMedium.select():
    for basic in medium.colorbasic_set:
        color_medium.append(medium.name)
        color_basic.append(basic.name)
        color_extracted[basic.name] = [c.hlc for c in basic.color_set]
color_extracted["color_medium"] = color_medium
color_extracted["color_basic"] = color_basic

#%%
pd.concat(
    [
        pd.DataFrame(item[1], columns=[item[0]])
        for item in color_extracted.items()
    ],
    axis=1,
).to_excel("extractedColorData.xlsx", index=None)
